package com.juc.forkJoinPool.forkJoinPool13;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;

public class Test1 {

	// public boolean awaitTermination(long timeout, TimeUnit unit)
	//作用：等待池被销毁的最长时间 具有阻塞特性
	public static void main(String[] args) throws InterruptedException {
		MyRunnable1 myRunnable =new MyRunnable1();
		ForkJoinPool pool  = new ForkJoinPool();
		pool.execute(myRunnable);
		System.out.println("main begin "+ System.currentTimeMillis());
		System.out.println(pool.awaitTermination(10, TimeUnit.SECONDS));
		System.out.println("main end "+ System.currentTimeMillis());
		//此实验说明pool.awaitTermination()方法具有阻塞特性
		
	}
}
